Skip to content

fix(dashboards): Render unfurl chart with dual Y axes for multi-aggregate widgets#115411

Merged
DominikB2014 merged 4 commits into
masterfrom
dominikbuszowiecki/fix/dashboards-unfurl-dual-yaxis
May 13, 2026
Merged

fix(dashboards): Render unfurl chart with dual Y axes for multi-aggregate widgets#115411
DominikB2014 merged 4 commits into
masterfrom
dominikbuszowiecki/fix/dashboards-unfurl-dual-yaxis

Conversation

@DominikB2014
Copy link
Copy Markdown
Contributor

@DominikB2014 DominikB2014 commented May 12, 2026

Multi-aggregate dashboard widgets (e.g. count(span.duration) + avg(span.duration)) previously rendered with a single Y axis in Slack unfurl charts, even when the dashboard UI showed two. The chartcuterie config now reuses the dashboard's axis partitioning so unfurls render the same way as the UI — count on the left, duration on the right.

Shared partitioner

assignPlottablesToYAxes lives next to the rest of the time-series widget code and is consumed by both TimeSeriesWidgetVisualization and chartcuterie/timeseries.tsx. It encapsulates the same rules used in the UI: one type → left only; two types → split; three+ types → first on left, rest on right (or all on left when the first type is the fallback).

Code generated with Claude

…gate widgets

Multi-aggregate widgets (e.g. `count(span.duration)` + `avg(span.duration)`)
previously rendered with a single Y axis in Slack unfurl charts. The
chartcuterie config now reuses the dashboard's axis partitioning so unfurls
match the UI.

Extracts the partitioning into `assignPlottablesToYAxes` so the dashboard
widget visualization and the chartcuterie unfurl chart share one
implementation.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.50% 93.50% ±0%
Typed 135,324 135,346 🟢 +22
Untyped 9,411 9,411 ±0
🔍 4 new type safety issues introduced

Non-null assertions (!) (2 new)

File Line Detail
static/app/views/dashboards/widgets/timeSeriesWidget/assignPlottablesToYAxes.tsx 73 leftYAxisDataTypes.at(0)!
static/app/views/dashboards/widgets/timeSeriesWidget/assignPlottablesToYAxes.tsx 94 relevantUnits[0]!

Type assertions (as) (2 new)

File Line Detail
static/app/views/dashboards/widgets/timeSeriesWidget/assignPlottablesToYAxes.tsx 99 as AggregationOutputTypetype as AggregationOutputType
static/app/views/dashboards/widgets/timeSeriesWidget/assignPlottablesToYAxes.tsx 105 as AggregationOutputTypetype as AggregationOutputType

This is informational only and does not block the PR.

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d0f1978. Configure here.

A `null` `dataUnit` is a legitimate "unitless" value. Previously the
truthiness check on `units[0]` dropped a consensus `null` through to the
fallback unit lookup (e.g. `duration` → `millisecond`), diverging from the
dashboard's original behavior.
Matches the partitioning, comments, and Sentry error logging from the
in-line implementation that used to live in `TimeSeriesWidgetVisualization`.
The visualization now delegates yAxisPosition resolution to
`assignPlottablesToYAxes` instead of duplicating the if/else block, and
the chartcuterie call site renames `realizedPlottables` to `plottables`.
@DominikB2014 DominikB2014 marked this pull request as ready for review May 12, 2026 20:55
@DominikB2014 DominikB2014 requested review from a team as code owners May 12, 2026 20:55
@DominikB2014 DominikB2014 merged commit c94162f into master May 13, 2026
76 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/fix/dashboards-unfurl-dual-yaxis branch May 13, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants